var Scene3D = (function(){
    function Scene3DClass(uiClass){
        this._isInit = false;
        this.___uiKey = '';
        this._node = null;
    }

    Scene3DClass.prototype.createNode = function(){
        var node = new Laya.Sprite3D();
        this._node = node;
        this._node.zOrder = 20;
    };

    Scene3DClass.prototype.init = function(key){
        this.___uiKey = key;
    };


    Scene3DClass.prototype.initScene = function(node){
        // override
    };

    Scene3DClass.prototype.onActive = function(from){
        // override
    };

    Scene3DClass.prototype.onInActive = function(){
        // override
    };

    Scene3DClass.prototype.active = function(from){
        if(!this._isInit){
            this.createNode();
            GlobalScene.addChild(this._node);
            this.initScene(this._node);
            this._isInit = true;
        }
        this.onActive(from);
    };

    Scene3DClass.prototype.inActive = function(){
        this.onInActive();
        if(this._node){
            this._node.destroy();
            this._node = null;
            this._isInit = false;
        }
    };

    Scene3DClass.prototype._uninit = function(){
        Tool.log("---Scene3D::_uninit name="+this.___uiKey);
        if(this._isInit){
            this.onInActive();
        }
        if(this._node){
            this._node.destroy();
        }
    };

    return Scene3DClass;
})();
